package com.jpa.demo.bean;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 * <p>Title:Person</p>
 * <p>Description:</p>
 * @company sinobest 
 * @author Administrator
 * @date 2016年10月9日 上午1:58:05
 * 
 */
@Entity
@Table(name="t_person")
public class Person implements Serializable {

	/** serialVersionUID*/
	private static final long serialVersionUID = -648279430384372104L;
	
	@Id
	private String id;
	private String name;
	private Long salary;
	
	@Temporal(TemporalType.DATE) //时间格式
	private Date birth;
	
	@Enumerated(EnumType.STRING)
	@Column(length=10,nullable=false)
	private Gender gender =Gender.MAM; //性别
		
	@Lob
	private String info;//大字段
	@Lob
	private Byte[] file;
 	
	@Lob 
 	@Basic(fetch=FetchType.LAZY) //大字段，延迟加载（一般操作1M 就应该使用该字段）
 	private Byte[] bigFile;
	
	@Transient
	private String imagePaht;//忽略字段，不和数据库做映射
	
	
	public Person() {
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getSalary() {
		return salary;
	}

	public void setSalary(Long salary) {
		this.salary = salary;
	}

	public Date getBirth() {
		return birth;
	}

	public void setBirth(Date birth) {
		this.birth = birth;
	}

	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public String getInfo() {
		return info;
	}

	public void setInfo(String info) {
		this.info = info;
	}

	public Byte[] getFile() {
		return file;
	}

	public void setFile(Byte[] file) {
		this.file = file;
	}

	public String getImagePaht() {
		return imagePaht;
	}

	public void setImagePaht(String imagePaht) {
		this.imagePaht = imagePaht;
	}
}
